//
//  TTDiamondDetailBigViewCell.m
//  TaoTuo
//
//  Created by 周晨晔 on 2019/9/18.
//  Copyright © 2019 admin. All rights reserved.
//

#import "TTDiamondDetailBigViewCell.h"

@implementation TTDiamondDetailBigViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.backgroundColor = kMainColor;
        self.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    return self;
}

- (void)setTitlesArray:(NSArray *)titlesArray contentsArray:(NSArray *)contentsArray
{
    NSAssert(titlesArray.count == contentsArray.count, @"两个数组的元素个数必须相同");
    
    CGFloat w = (SCREEN_WIDTH - 10 - 10*kScale) / 3.0;
    CGFloat H = 30;
    for (int i = 0; i < titlesArray.count; i++) {
        
        NSString *str = [NSString stringWithFormat:@"%@: %@", titlesArray[i], contentsArray[i]];
        UILabel *label = [UILabel labelWithTitle:str color:[UIColor whiteColor] fontSize:14];
        [self.contentView addSubview:label];
        
        CGFloat top = H * (i / 3);
        CGFloat left = 10 + w * (i % 3);
        
        [label mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(top);
            make.left.mas_equalTo(left);
            make.height.mas_equalTo(H);
            make.width.mas_equalTo(w);
        }];

    }
    
    CGFloat totalH = H * ceil(titlesArray.count / 3.0);
    
    [LLLineUtilies addLineInView:self.contentView startPoint:CGPointMake(w, 10) endPoint:CGPointMake(w, totalH - 10) lineColor:[UIColor whiteColor]];
    
    [LLLineUtilies addLineInView:self.contentView startPoint:CGPointMake(2 * w, 10) endPoint:CGPointMake(2 * w, totalH - 10) lineColor:[UIColor whiteColor]];
    
    
}





@end
